package com.example.demo.controller;

import com.example.demo.Mappers.GetMZFYListMapper;
import com.example.demo.beans.GetMZFYItem;
import com.example.demo.beans.GetMZFYListRequest;
import com.example.demo.beans.GetMZFYListResponse;
import com.example.demo.beans.GetRecipeListItem2;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2018-05-21.
 */
@RestController
public class GetMZFYListController {
@Autowired
private GetMZFYListMapper mapper;
 @ResponseBody
 @RequestMapping(value = "GetMZFYList",produces = {"application/xml"})
 public GetMZFYListResponse getmzfyRespone(@RequestBody GetMZFYListRequest request)
{if(request!=null){
 List<GetMZFYItem> items=mapper.getMzfyItem(request.getCardNo(),request.getStartDate(),request.getEndDate());
GetMZFYListResponse response =new GetMZFYListResponse();
response.setResultCode("0");
response.setResultMsg("交易成功！");
response.setItems(items);
return  response;
}
return  null;
}
}
